package com.tianji.learning.controller;


import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.dto.QuestionFormDTO;
import com.tianji.learning.domain.query.QuestionAdminPageQuery;
import com.tianji.learning.domain.query.QuestionPageQuery;
import com.tianji.learning.domain.query.ReplyPageQuery;
import com.tianji.learning.domain.vo.QuestionAdminVO;
import com.tianji.learning.domain.vo.QuestionVO;
import com.tianji.learning.domain.vo.ReplyVO;
import com.tianji.learning.service.IInteractionQuestionService;
import com.tianji.learning.service.IInteractionReplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.jaxb.SpringDataJaxb;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 互动提问的问题表 前端控制器
 * </p>
 *
 * @author LYY
 * @since 2025-05-11
 */
@Api(tags = "互动问题相关接口-管理端")
@RestController
@RequiredArgsConstructor
@RequestMapping("/admin/questions")
public class InteractionQuestionAdminController {
    private final IInteractionQuestionService questionService;
    private final IInteractionReplyService replyService;
   @ApiOperation("分页查询问题列表-管理端")
    @GetMapping("page")
    public PageDTO<QuestionAdminVO> queryQuestionAdminVoPage(QuestionAdminPageQuery query){
       return questionService.queryQuestionAdminVoPage(query);
   }

    @ApiOperation("隐藏显示回答或评论")
    @PutMapping("{id}/hidden/{hidden}")
    public void hiddenReplyAdmin(@PathVariable("id") Long id, @PathVariable("hidden") Boolean hidden){
        replyService.hiddenReplyAdmin(id, hidden);
    }
    @ApiOperation("查询回答或评论详情-管理端")
    @GetMapping("{id}")
    public ReplyVO queryReplyVO(@PathVariable("id") Long id){
        return replyService.queryAdminReplyById(id);
    }
}
